﻿namespace OrderServiceLevel1
{
    using System.Web;

    public abstract class BaseHttpHandler : IHttpHandler
    {
        public virtual bool IsReusable
        {
            get
            {
                return true;
            }
        }

        public void ProcessRequest(HttpContext context)
        {
            context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            context.Response.Cache.SetNoStore();

            context.Response.AppendHeader("Access-Control-Allow-Origin", "*");
            context.Response.AppendHeader("Access-Control-Allow-Methods", "GET");
            context.Response.AppendHeader("Access-Control-Allow-Headers", "*");

            this.ProcessRequest(new HttpContextWrapper(context));
        }

        public abstract void ProcessRequest(HttpContextBase context);
    }
}